package ru.urfc.portal.model.documents;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import ru.urfc.portal.model.SysObject;
import ru.urfc.portal.ui.client.Constants;

@Entity
@XmlRootElement(name = Constants.DOCUMENT_STATE_CHANGE)
public class DocumentStateChange extends SysObject {
	
	@XmlTransient
	public Document document;
	@Temporal(TemporalType.DATE)
	public Date changeDate;
	@ManyToOne(fetch = FetchType.EAGER)
	public DocumentState state;
	public String comment;

	public DocumentStateChange() {
	}

	public DocumentStateChange(Document document, Date changeDate, DocumentState state,
			String comment) {
		this.document = document;
		this.changeDate = changeDate;
		this.state = state;
		this.comment = comment;
	}

}
